﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Dom2
{
    public partial class index : System.Web.UI.Page
    {
        public static List<Zuoye> shops = new List<Zuoye>();
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            if (FileUpload1.HasFile)
            {
                string filepath = Server.MapPath("/wenjian/");
                string finame = FileUpload1.PostedFile.FileName;
                FileUpload1.SaveAs(filepath+finame);
                
                Response.Write("<script>alert('文件上传成功')</script>");
            }
            else
            {
                Response.Write("<script>alert('请选择要上传的文件')</script>");
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string kecheng = this.DropDownList1.Text;
            string tima = this.DropDownList2.Text;
            string name = this.TextBox1.Text;
            int xuehao = int.Parse(this.TextBox2.Text.ToString());
            shops.Clear();
            Zuoye s1 = new Zuoye() { Kecheng = kecheng, Timu = tima, Name = name, Xuehao = xuehao };
            shops.Add(s1);
            Response.Write("<script>alert('提交成功')</script>");

        }
    }
}